package day12;

/**
 * @author joker
 * @date 2022/4/22 0022 - 23:25
 */
public class Test04 {
    public static void main(String[] args) throws CloneNotSupportedException {
        Person person = new Person();
        Man man = new Man();
        man.setId(2);
        person.setMan(man);
        System.out.println(person+"\tperson");
        Person p2 = (Person) person.clone();
        System.out.println(p2+"\tp2");
        person.setA(2);
        person.getMan().setId(3);
        System.out.println(person+"\tperson");
        System.out.println(p2+"\tp2");
    }
}
